<!doctype html>
<html lang="zh-CN" id="index">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="format-detection" content="telephone=no, email=no" />
<meta name="keywords" content="">
<meta name="description" content="">
<title>图片裁剪</title>
<style>
body {
	margin: 0;
	text-align: center;
}
#clipArea {
	margin: 20px;
	height: 300px;
}
#file,
#clipBtn {
	margin: 20px;
}
#btn,
#clipBtn{
	width: 80px;
	height: 30px;
	border: 0;
	border-radius: 3px;
	background: #2780FF;
	color: white;
}
#view {
	margin: 0 auto;
	width: 200px;
	height: 200px;
}
.upload_img_div{
	width: 350px;
	height: 350px;
	float: left;
}
</style>
</head>
<body ontouchstart="" style="width: 800px; margin: 0 auto;">
<div class="upload_img_div">
	<div id="clipArea"></div>
</div>

<input type="file" id="file">
<br />
<button id="clipBtn">截取封面</button>
<img style="display: block;" id="view"></img>

<!--<script src="http://www.jq22.com/jquery/2.1.1/jquery.min.js"></script>-->
<script src="uploadimgjs/jquery-2.1.3.min.js"></script>
<script src="uploadimgjs/iscroll-zoom.js"></script>
<script src="uploadimgjs/hammer.js"></script>
<script src="uploadimgjs/lrz.all.bundle.js"></script>
<script src="uploadimgjs/jquery.photoClip.js"></script>
<script src="uploadimgjs/updateSongListImg.js"></script>
<script>
//document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
var clipArea = new bjj.PhotoClip("#clipArea", {
	size: [200, 200],
	outputSize: [640, 640],
	file: "#file",
	view: "#view",
	ok: "#clipBtn",
	loadStart: function() {
		console.log("照片读取中");
	},
	loadComplete: function() {
		console.log("照片读取完成");
	},
	clipFinish: function(dataURL) {
		console.log(dataURL);
	}
});
//clipArea.destroy();
</script>
<button id="btn" style="margin-top: 30px;">确认修改</button>
</body>
</html>